package com.example.pkmedical.Activity.weight.tozero;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextClock;
import android.widget.TextView;

import com.example.pkmedical.APP.MyApp;
import com.example.pkmedical.Activity.weight.tozero.NewUserZreoActivity;
import com.example.pkmedical.Activity.weight.tozero.ZeroRemindActivity;
import com.example.pkmedical.Base.BaseActivity;
import com.example.pkmedical.R;
import com.example.pkmedical.Utils.CommandUtil;
import com.example.pkmedical.Utils.SPUtils;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class ToZeroHomeActivity extends BaseActivity {

    @BindView(R.id.main_house)
    ImageView mainHouse;
    @BindView(R.id.main_house_text)
    TextView mainHouseText;
    @BindView(R.id.tozero_tozero_time)
    TextView tozeroTozeroTime;
    @BindView(R.id.tozero_tozero_button)
    Button tozeroTozeroButton;
    @BindView(R.id.tozero_newuser_time)
    TextView tozeroNewuserTime;
    @BindView(R.id.tozero_newuser_button)
    Button tozeroNewuserButton;
    @BindView(R.id.zerohome_back_button)
    Button zerohomeBackButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_tozerohome);
        ButterKnife.bind(this);
    }

    @Override
    public void initData() {

    }

    @Override
    public void initView() {
        mainHouse.setImageResource(R.drawable.img_title_weight);
        mainHouseText.setText(R.string.title_weight);
    }

    @Override
    public void initPresenter() {

    }

    @Override
    public void showDialog(String... msg) {

    }

    @Override
    protected void onResume() {
        super.onResume();
        tozeroTozeroTime.setText(SPUtils.getInstance().getString("TOZERO_DATA"));
        tozeroNewuserTime.setText(SPUtils.getInstance().getString("NEWUSER_ZERO_DATA"));
    }

    @OnClick({R.id.tozero_tozero_button, R.id.tozero_newuser_button, R.id.zerohome_back_button})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tozero_tozero_button:
                CommandUtil.ZERO_TYPE = 1;
                startActivity(new Intent(MyApp.getAppContext(), ZeroRemindActivity.class));

                break;
            case R.id.tozero_newuser_button:
                CommandUtil.ZERO_TYPE = 2;
                startActivity(new Intent(MyApp.getAppContext(), NewUserZreoActivity.class));
                break;
            case R.id.zerohome_back_button:
                finish();
                break;

        }
    }
}
